Skip to content

Estimators

Platon I. Karpov edited this page Aug 30, 2022 · 22 revisions

😨 This Wiki is depreciated 😨 Visit the new Wiki at sapsan-wiki.github.io


Depreciated Estimators

Sapsan has several models in its arsenal to get started.

Convolution Neural Network (CNN)

cnn_model_graph

Example: cnn_example.ipynb
Estimator: cnn3d_estimator.py

The network is based around Conv3d and MaxPool3d layers, reducing the spatial dimensions down to 1 by increasing the number of features. In order to do that, the network iterates over the following NN block:

def nn_block():
  torch.nn.Conv3d(D_in, D_in*2, kernel_size=2, stride=2, padding=1)
  torch.nn.MaxPool3d(kernel_size=2, padding=1)

where D_in is the input dimension.

As final layers, ReLU activation function is used and the data is linearized. An example model graph for the input data with the spatial dimensions of [16, 16, 16] split into 8 batches is provided below.



Kernel Ridge Regression (KRR)

Example: krr_example.ipynb
Estimator: krr_estimator.py

We have included one of the classic regression-based methods used in machine learning - Kernel Ridge Regression. The model has two hyperparameters to be tuned: regularization term α and full-width at half-max σ. KRR has the following form:

y′ = y(K + α I) − 1k

where K is the kernel, chosen to be the radial basis function (gaussian):

K(x, x′) = exp( − ||x − x′||2 / 2σ2)

Physics-Informed CNN for Turbulence Modeling

pimlturb_model_graph

Accepted 2022, Astrophysical Journal (ApJ)

Example: pimlturb_diagonal_example.ipynb
Estimator: pimlturb_diagonal_estimator.py

The estimator is based on Physics-Informed Machine Learning for Modeling Turbulence in Supernovae by P.I.Karpov et al. The model is based on a 3D convolutional network with some additions to enforce a realizability constraint (Reii > 0, where Re is the Reynolds stress tensor and i is the component index). Its overall schematic and graph are shown below.

The method also utilizes a custom loss that combines statistical (Kolmogorov-Smirnov Statistic) and spatial (Smooth L1) losses. The full description can be found in the paper linked above.

For the example included in Sapsan, the data included is from the same dataset as the publication, but it has been heavily sampled (down to 173). To achieve comparable published results, the model will need to be trained for 3000-4000 epochs.

cnn_model_schematic



Physics-Informed Convolutional Autoencoder (PICAE)

Example: picae_example.ipynb
Estimator: picae_estimator.py

Note: The estimator is based on Embedding Hard Physical Constraints in Neural Network Coarse-Graining of 3D Turbulence by M.T.Arvind et al.

The model consists of 2 main parts:

  1. Convolutional Auto-Encoder (trainable)
  2. Static layers enforcing divergence-free condition (constant)

Thus, the latter force the CAE portion of the model to adjust to the curl of A to be 0. Through this, we are effectively enforcing the conservation of mass. A schematic of the model is shown below.

physics-informed cae